home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / battutor.arc / Q < prev    next >
Text File  |  1986-05-05  |  3KB  |  71 lines

  1. ;
  2. ;                               q_cmds.inc
  3. ;
  4. ;
  5. ;       This INCLUDE file provides the tables and table-driven code
  6. ;       to implement a set of slash commands in command lines given
  7. ;       to QUERY, FUNKY, and other utilities.
  8. ;
  9. ;       To add a new command, increase the CMD_TOTAL param by one,
  10. ;       add the two characters that identify the command (usually
  11. ;       upper and lower case of a letter character) to the CMD_LETTERS
  12. ;       table, and add the entry point to the command execute procedure
  13. ;       to the CMD_OFFSETS table.
  14. ;
  15. ;
  16. CMD_TOTAL       DW      3                       ;total commands defined
  17. ;
  18. CMD_LETTERS     DB      'B','b'                 ;"beep" command
  19.                 DB      'L','l'                 ;"skip line" command
  20.                 DB      'D','d'                 ;"delimiter line" command
  21. ;
  22. CMD_OFFSETS     DW      BEEP                    ;"beep" procedure
  23.                 DW      SKIP                    ;"skip line" procedure
  24.                 DW      DELIM_LINE              ;"delimiter line" procedure
  25. ;
  26. ;       equates for procedures
  27. ;
  28. BORDER_CHAR     EQU     0CDH                    ;"double line" graphics char
  29. ;
  30. ;       data for procedures
  31. ;
  32. NEW_LINE        DB      CR,LF,'$'
  33. ;
  34. ;       procedure code
  35. ;
  36. BEEP            PROC    NEAR
  37.                 MOV     DL,BEL_CHAR             ;ascii bell char code
  38.                 MOV     AH,2                    ;"display one char" DOS call
  39.                 INT     21H                     ;call DOS
  40.                 RET                             ;done
  41. BEEP            ENDP
  42. ;
  43. SKIP            PROC    NEAR
  44.                 MOV     DX,OFFSET NEW_LINE      ;offset of CR, LF
  45.                 MOV     AH,9                    ;"display string" DOS call
  46.                 INT     21H                     ;call DOS
  47.                 RET                             ;done
  48. SKIP            ENDP
  49. ;
  50. DELIM_LINE      PROC    NEAR
  51.                 MOV     AH,15                   ;"get current page" BIOS call
  52.                 INT     10H                     ;call BIOS video
  53.                 PUSH    AX                      ;save number of cols in AH
  54.                 MOV     AH,8                    ;"get current attribute" call
  55.                 INT     10H                     ;call BIOS video
  56.                 MOV     BL,AH                   ;attribute into BL
  57.                 POP     AX                      ;number cols restored in AH
  58.                 SUB     CH,CH                   ;zero CH
  59.                 MOV     CL,AH                   ;move number of cols to CL
  60.                 MOV     AL,BORDER_CHAR          ;character code into AL
  61.                 MOV     AH,9                    ;"display char/attrib" BIOS call
  62.                 INT     10H                     ;call BIOS video
  63.                 MOV     DX,OFFSET NEW_LINE      ;skip line
  64.                 MOV     AH,9                    ;"display string" DOS call
  65.                 INT     21H                     ;call DOS
  66.                 RET                             ;done
  67. DELIM_LINE      ENDP
  68. ;
  69. ;               --------        end of q_cmds.inc       --------
  70. ;
  71.          cmd2.                               s